(()=>{"use strict";var e,t={44943:(e,t,a)=>{a(80102),a(46298);var n=a(73896),l=a(65024),o=c(a(90682));a(19867),a(42362);var r=c(a(63859)),i=c(a(62616)),d=c(a(94735)),u=c(a(20073)),s=c(a(82193));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}o.default.extend(r.default),d.default._internal.challenge={};var p=[],w=[],v=[];function m(e){var t,a,n,l=function(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=h(e))){a&&(e=a);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,i=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return r=e.done,e},e:function(e){i=!0,o=e},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw o}}}}(document.cookie.split("; "));try{for(l.s();!(t=l.n()).done;){var o=(a=t.value.split("="),n=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,l,o,r,i=[],d=!0,u=!1;try{if(o=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;d=!1}else for(;!(d=(n=o.call(a)).done)&&(i.push(n.value),i.length!==t);d=!0);}catch(e){u=!0,l=e}finally{try{if(!d&&null!=a.return&&(r=a.return(),Object(r)!==r))return}finally{if(u)throw l}}return i}}(a,n)||h(a,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r=o[0],i=o[1];if(r===e)return decodeURIComponent(i)}}catch(e){l.e(e)}finally{l.f()}return null}function b(e){var t=e.category.replace(/ /g,"-").hashCode(),a="#{0}-page-row".format(t);(0,i.default)("#pages-board").find(".active").removeClass("active"),(0,i.default)("#pages-board").find(a).addClass("active");var n=e.name.replace(/ /g,"-").hashCode();!function(e){if(!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)}(e)){var t=window.innerHeight||document.documentElement.clientHeight,a=e.getBoundingClientRect().top+window.scrollY-t/3;window.scrollTo({top:a,behavior:"smooth"})}}(i.default.find("#"+n)[0])}var y=function(e){var t=i.default.grep(p,(function(t){return t.id==e}))[0];b(t),"hidden"!==t.type?C(t):(0,n.ezAlert)({title:"en"===m("Scr1wCTFdLanguage")?"Challenge Hidden!":"题目已隐藏！",body:"en"===m("Scr1wCTFdLanguage")?"You haven't unlocked this challenge yet!":"你尚未解锁这个题目！",button:"en"===m("Scr1wCTFdLanguage")?"Got it!":"好的！"})},C=function(e){return Promise.all([d.default.api.get_challenge({challengeId:e.id}),i.default.getScript(u.default.urlRoot+e.script),i.default.get(u.default.urlRoot+e.template)]).then((function(t){var a=d.default._internal.challenge;(0,i.default)("#challenge-window").empty(),a.data=t[0].data,a.preRender(),(0,i.default)("#challenge-window").append(t[0].data.view),(0,i.default)("#challenge-window #challenge-input").addClass("form-control"),(0,i.default)("#challenge-window #challenge-submit").addClass("btn btn-md btn-outline-secondary float-right");var n=(0,i.default)("#challenge-window").find(".modal-dialog");if(window.init.theme_settings&&window.init.theme_settings.challenge_window_size)switch(window.init.theme_settings.challenge_window_size){case"sm":n.addClass("modal-sm");break;case"lg":n.addClass("modal-lg");break;case"xl":n.addClass("modal-xl")}(0,i.default)(".challenge-solves").click((function(e){x((0,i.default)("#challenge-id").val())})),(0,i.default)(".nav-tabs a").click((function(e){e.preventDefault(),(0,i.default)(this).tab("show")})),(0,i.default)("#challenge-window").on("hide.bs.modal",(function(e){(0,i.default)("#challenge-input").removeClass("wrong"),(0,i.default)("#challenge-input").removeClass("correct"),(0,i.default)("#incorrect-key").slideUp(),(0,i.default)("#correct-key").slideUp(),(0,i.default)("#already-solved").slideUp(),(0,i.default)("#too-fast").slideUp()})),(0,i.default)(".load-hint").on("click",(function(e){I((0,i.default)(this).data("hint-id"))})),(0,i.default)("#challenge-submit").click((function(e){e.preventDefault(),(0,i.default)("#challenge-submit").addClass("disabled-button"),(0,i.default)("#challenge-submit").prop("disabled",!0),d.default._internal.challenge.submit().then(_).then(S).then(k)})),(0,i.default)("#challenge-input").keyup((function(e){13==e.keyCode&&(0,i.default)("#challenge-submit").click()})),a.postRender(),(0,i.default)("#challenge-window").find("pre code").each((function(e){s.default.highlightBlock(this)})),window.location.replace(window.location.href.split("#")[0]+"#".concat(e.name,"-").concat(e.id)),(0,i.default)("#challenge-window").modal()}))};function _(e){var t=e.data,a=(0,i.default)("#result-message"),n=(0,i.default)("#result-notification"),l=(0,i.default)("#challenge-input");n.removeClass(),a.text(t.message);var o=(0,i.default)("<div class='col-md-12 pb-3'><button class='challenge-submit btn btn-info w-100 '>"+("en"===m("Scr1wCTFdLanguage")?"Next Challenge":"下一题")+"</button></div>").click((function(){(0,i.default)("#challenge-window").modal("toggle"),setTimeout((function(){y(d.default._internal.challenge.data.next_id)}),500)}));"authentication_required"!==t.status?("incorrect"===t.status?(n.addClass("alert alert-danger alert-dismissable text-center"),n.slideDown(),l.removeClass("correct"),l.addClass("wrong"),setTimeout((function(){l.removeClass("wrong")}),3e3)):"correct"===t.status?(n.addClass("alert alert-success alert-dismissable text-center"),n.slideDown(),(0,i.default)(".challenge-solves").text().trim()&&(0,i.default)(".challenge-solves").text(parseInt((0,i.default)(".challenge-solves").text().split(" ")[0])+1+("en"===m("Scr1wCTFdLanguage")?" Solves":"人解出")),l.val(""),l.removeClass("wrong"),l.addClass("correct"),d.default._internal.challenge.data.next_id&&(0,i.default)(".submit-row").html(o)):"already_solved"===t.status?(n.addClass("alert alert-info alert-dismissable text-center"),n.slideDown(),l.addClass("correct"),d.default._internal.challenge.data.next_id&&(0,i.default)(".submit-row").html(o)):"paused"===t.status?(n.addClass("alert alert-warning alert-dismissable text-center"),n.slideDown()):"ratelimited"===t.status&&(n.addClass("alert alert-warning alert-dismissable text-center"),n.slideDown(),l.addClass("too-fast"),setTimeout((function(){l.removeClass("too-fast")}),3e3)),setTimeout((function(){(0,i.default)(".alert").slideUp(),(0,i.default)("#challenge-submit").removeClass("disabled-button"),(0,i.default)("#challenge-submit").prop("disabled",!1)}),3e3)):window.location=d.default.config.urlRoot+"/login?next="+d.default.config.urlRoot+window.location.pathname+window.location.hash}function k(){p.map((function(e){if(e.solved_by_me){var t=(0,i.default)('button[value="'.concat(e.id,'"]'));t.find("i.fas.fa-check").length||(t.addClass("solved-challenge"),t.append("<i class='fas fa-check'></i>"))}}))}function x(e){return d.default.api.get_challenge_solves({challengeId:e}).then((function(e){var t=e.data;(0,i.default)(".challenge-solves").text(parseInt(t.length)+("en"===m("Scr1wCTFdLanguage")?" Solves":"人解出"));var a=(0,i.default)("#challenge-solves-names");a.empty();for(var n=0;n<t.length;n++){var r=t[n].account_id,d=t[n].name,u=(0,o.default)(t[n].date).fromNow(),s=t[n].account_url;a.append('<tr><td><a href="{0}">{2}</td><td>{3}</td></tr>'.format(s,r,(0,l.htmlEntities)(d),u))}}))}function S(){return d.default.api.get_challenge_list().then((function(e){var t=(0,i.default)("#challenges-board"),a=(0,i.default)("#pages-board");p=e.data;try{p=function(e){var t=["PWN","REVERSE","WEB","CRYPTO","MISC","OSINT","IOT"],a=e.filter((function(e){return t.includes(e.category)})).sort((function(e,a){return t.indexOf(e.category.toUpperCase())-t.indexOf(a.category.toUpperCase())})),n=e.filter((function(e){return!t.includes(e.category)})).sort((function(e,t){var a=e.category.toUpperCase(),n=t.category.toUpperCase();return a<n?-1:a>n?1:0}));return[].concat(f(a),f(n))}(p)}catch(e){console.warn(e)}if(0!==p.length){t.empty(),t.addClass("tab-content"),window.init.theme_settings&&window.init.theme_settings.page_bar_shown&&"shown"===window.init.theme_settings.page_bar_shown?(0,i.default)("#pages-board-container").show():(0,i.default)("#pages-board-container").hide();for(var l=function(){var e=p[o];if(-1==i.default.inArray(e.category,v)){var t=e.category;v.push(t);var n=t.replace(/ /g,"-").hashCode(),l=(0,i.default)("<a "+'id="{0}-page-row" class="nav-link challenge-nav-link" '.format(n)+'data-toggle="tab" role="tab" href="#{0}-row"'.format(n)+">"+t.slice(0,15)+"</a>");1===v.length&&l.addClass("active"),l.on("shown.bs.tab",(function(){var e=(0,i.default)("#{0}-row".format(n))[0];window.scrollTo({top:(0,i.default)(e).offset().top-28,behavior:"smooth"})})),a.append(l)}},o=0;o<=p.length-1;o++)l();for(var r=0;r<=v.length-1;r++){var d=v[r],u=d.replace(/ /g,"-").hashCode(),s=(0,i.default)(""+'<div id="{0}-row" class="pt-4" role="tabpanel"><div class="category-header col-md-12 mb-3"><h3>{1}</h3></div><div class="category-challenges col-md-12" id="{2}-base"><div class="challenges-row col-md-12" id="{3}-base-row"></div></div></div>'.format(u,d,u,u));t.append(s)}for(var c=0;c<=p.length-1;c++){var h=p[c],g=h.name.replace(/ /g,"-").hashCode(),b=h.category.replace(/ /g,"-").hashCode(),C=(0,i.default)("<div id='{0}' class='col-md-3 d-inline-block challenge-button-container' ></div>".format(g)),_=void 0;_=-1==w.indexOf(h.id)?(0,i.default)("<button class='btn btn-dark challenge-button w-100 text-truncate pt-3 pb-3 mb-2 challenge-button-content' value='{0}'></button>".format(h.id)):(0,i.default)("<button class='btn btn-dark challenge-button solved-challenge w-100 text-truncate pt-3 pb-3 mb-2 challenge-button-content' value='{0}'><i class='fas fa-check'></i></button>".format(h.id));for(var k=(0,i.default)("<p>{0}</p>".format(h.name)),x=(0,i.default)("<span>{0}</span>".format(h.value)),S=0;S<h.tags.length;S++){var T="tag-"+h.tags[S].value.replace(/ /g,"-");C.addClass(T)}_.append(k),_.append(x),C.append(_),(0,i.default)("#"+b+"-row").find(".category-challenges").find("#"+b+"-base-row").append(C)}(0,i.default)(".challenge-button").click((function(e){y(this.value)}))}else"en"===m("Scr1wCTFdLanguage")?(0,n.ezToast)({title:"Auto refresh failed",body:"Challenge data is empty!"}):(0,n.ezToast)({title:"自动刷新失败",body:"题目数据为空！"})}))}function T(){return S().then(k)}(0,i.default)((function(){T().then((function(){window.location.hash.length>0&&function(e){if(e.includes("-page-row")){var t="#{0}".format(e);if(0!==(0,i.default)("#pages-board").find(t).length){(0,i.default)("#pages-board").find(".active").removeClass("active"),(0,i.default)("#pages-board").find(t).addClass("active").trigger("shown.bs.tab");var a=e.split("-page-row")[0],n=(0,i.default)("#{0}-row".format(a))[0];return void window.scrollTo({top:(0,i.default)(n).offset().top-28,behavior:"smooth"})}}var l=e.lastIndexOf("-"),o=(e.slice(0,l),e.slice(l+1)),r=i.default.grep(p,(function(e){return e.id==o}))[0];b(r),C(r)}(decodeURIComponent(window.location.hash.substring(1)))})),(0,i.default)("#challenge-input").keyup((function(e){13==e.keyCode&&(0,i.default)("#challenge-submit").click()})),(0,i.default)(".nav-tabs a").click((function(e){e.preventDefault(),(0,i.default)(this).tab("show")})),(0,i.default)("#challenge-window").on("hidden.bs.modal",(function(e){(0,i.default)(".nav-tabs a:first").tab("show"),history.replaceState("",window.document.title,window.location.pathname)})),(0,i.default)(".challenge-solves").click((function(e){x((0,i.default)("#challenge-id").val())})),(0,i.default)("#challenge-window").on("hide.bs.modal",(function(e){(0,i.default)("#challenge-input").removeClass("wrong"),(0,i.default)("#challenge-input").removeClass("correct"),(0,i.default)("#incorrect-key").slideUp(),(0,i.default)("#correct-key").slideUp(),(0,i.default)("#already-solved").slideUp(),(0,i.default)("#too-fast").slideUp()}))})),setInterval(T,3e5);var O=function(e){(0,n.ezAlert)({title:"en"===m("Scr1wCTFdLanguage")?"Hint":"提示",body:e.html,button:"en"===m("Scr1wCTFdLanguage")?"Got it!":"好的！"})},I=function(e){d.default.api.get_hint({hintId:e}).then((function(t){if(t.success)t.data.content?O(t.data):function(e){(0,n.ezQuery)({title:"en"===m("Scr1wCTFdLanguage")?"Unlock Hint?":"解锁提示？",body:"en"===m("Scr1wCTFdLanguage")?"Are you sure you want to open this hint?":"您确定要解锁此提示吗？",success:function(){var t={target:e,type:"hints"};d.default.api.post_unlock_list({},t).then((function(t){t.success?d.default.api.get_hint({hintId:e}).then((function(e){O(e.data)})):(0,n.ezAlert)({title:"en"===m("Scr1wCTFdLanguage")?"Error":"错误",body:t.errors.score,button:"en"===m("Scr1wCTFdLanguage")?"Got it!":"好的！"})}))}})}(e);else{var a=Object.values(t.errors).join("\n");alert(a)}}))};window.updateChallengeBoard=T},80102:(e,t,a)=>{var n=g(a(94735)),l=g(a(62616)),o=g(a(90682));a(19867),a(42362);var r=g(a(89816)),i=g(a(29010)),d=a(34178),u=g(a(17395)),s=g(a(20073)),c=g(a(4169)),f=g(a(65387)),h=g(a(9561));function g(e){return e&&e.__esModule?e:{default:e}}o.default.extend(r.default),n.default.init(window.init),window.CTFd=n.default,window.helpers=h.default,window.$=l.default,window.dayjs=o.default,window.nunjucks=i.default,window.Howl=d.Howl,(0,l.default)((function(){(0,c.default)(),(0,f.default)(),(0,u.default)(s.default.urlRoot)}))}},a={};function n(e){var l=a[e];if(void 0!==l)return l.exports;var o=a[e]={id:e,loaded:!1,exports:{}};return t[e](o,o.exports,n),o.loaded=!0,o.exports}n.m=t,e=[],n.O=(t,a,l,o)=>{if(!a){var r=1/0;for(s=0;s<e.length;s++){for(var[a,l,o]=e[s],i=!0,d=0;d<a.length;d++)(!1&o||r>=o)&&Object.keys(n.O).every((e=>n.O[e](a[d])))?a.splice(d--,1):(i=!1,o<r&&(r=o));if(i){e.splice(s--,1);var u=l();void 0!==u&&(t=u)}}return t}o=o||0;for(var s=e.length;s>0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[a,l,o]},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={33:0,671:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var l,o,[r,i,d]=a,u=0;if(r.some((t=>0!==e[t]))){for(l in i)n.o(i,l)&&(n.m[l]=i[l]);if(d)var s=d(n)}for(t&&t(a);u<r.length;u++)o=r[u],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(s)},a=self.webpackChunkctfd=self.webpackChunkctfd||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var l=n.O(void 0,[736,783],(()=>n(44943)));l=n.O(l)})();